package cn.taoticket.service;

import cn.taoticket.mapper.TaoticketCinemaSeatMapper;
import cn.taoticket.pojo.TaoticketCinemaSeat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by taoticket
 */
@RestController
public class RestTaoticketCinemaSeatService {

    @Resource
     private TaoticketCinemaSeatMapper taoticketCinemaSeatMapper;

     @RequestMapping(value = "/getTaoticketCinemaSeatById",method = RequestMethod.POST)
     public TaoticketCinemaSeat getTaoticketCinemaSeatById(@RequestParam("id") Long id)throws Exception{
        return taoticketCinemaSeatMapper.getTaoticketCinemaSeatById(id);
     }

     @RequestMapping(value = "/getTaoticketCinemaSeatListByMap",method = RequestMethod.POST)
     public List<TaoticketCinemaSeat> getTaoticketCinemaSeatListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketCinemaSeatMapper.getTaoticketCinemaSeatListByMap(param);
     }

     @RequestMapping(value = "/getTaoticketCinemaSeatCountByMap",method = RequestMethod.POST)
     public Integer getTaoticketCinemaSeatCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketCinemaSeatMapper.getTaoticketCinemaSeatCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddTaoticketCinemaSeat",method = RequestMethod.POST)
     public Integer qdtxAddTaoticketCinemaSeat(@RequestBody TaoticketCinemaSeat taoticketCinemaSeat)throws Exception{
        taoticketCinemaSeat.setCreatedTime(new Date());
        return taoticketCinemaSeatMapper.insertTaoticketCinemaSeat(taoticketCinemaSeat);
     }

     @RequestMapping(value = "/qdtxModifyTaoticketCinemaSeat",method = RequestMethod.POST)
     public Integer qdtxModifyTaoticketCinemaSeat(@RequestBody TaoticketCinemaSeat taoticketCinemaSeat)throws Exception{
        taoticketCinemaSeat.setUpdatedTime(new Date());
        return taoticketCinemaSeatMapper.updateTaoticketCinemaSeat(taoticketCinemaSeat);
     }
}
